package yf.mall;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;


@SpringBootApplication
@ComponentScan(basePackages = {"yf.mall", "com.yf"})
@MapperScan(basePackages = {"yf.mall.dao", "com.yf.dao"})
public class
Application extends SpringBootServletInitializer {
    //war打包发布到tomcat需要
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(Application.class);
    }
    public static void main(String[] args) {
        //主意args参数 否则 java -jar  启动参数不会生效 如--spring-profiles-active
         SpringApplication.run(Application.class,args);
    }

}
